package com.atguigu.ssyx.home.controller;
import com.atguigu.ssyx.client.product.ProductFeignClient;
import com.atguigu.ssyx.common.result.Result;
import com.atguigu.ssyx.model.product.Category;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * @作者:胡树苑
 * @时间:2025/9/21 14:53
 */
@Api(tags = "商品分类")
@RestController
@RequestMapping("/api/home")
public class CategoryApiController {

    @Resource
    private ProductFeignClient productFeignClient;
    //查询所有分类
    @ApiOperation(value = "获取分类信息")
    @GetMapping("/category")
    public Result index() {
        List<Category> allCategoryList = productFeignClient.findAllCategoryList();
        return Result.ok(allCategoryList);
    }
}
